
#include <stm32f10x.h>
#include "uart.h"
#include "systick.h"
#include "oled.h"
#include "dht11.h"
#include "aht10.h"
#include "at24c64.h"

char flg_blink = 0;
uint16_t adc_value[2];

int main(void)
{
	float temp,humi;

	uint8_t data;
	NVIC_PriorityGroupConfig(NVIC_PriorityGroup_0);
	delay_init();
	uart_init();
	
	OLED_Init();
	OLED_Clear();
	at24c64_init();

	AHT10_Init();
	
	at24c64_write(0,0x78);
	delay_ms(10);
	at24c64_read(0,&data);
	printf("at24c64_read:%#x\r\n",data);
	
	OLED_ShowString(40,0,(uint8_t*)"OLED_TEST",16);
	
	while (1)
	{
		AHT10_Read();

		temp = AHT10_GetTemperature();
		humi = AHT10_GetHumidity();

		printf("temp:%.2f humi:%.2f\r\n",temp,humi);

		delay_ms(500);
	}
}
